-- api: /frontend/acquire_data?user_id=USERID&type=led_display
-- type: led_display alarm history ubsubscribe
local args = ngx.req.get_uri_args()
local func = args.type
local user_id = args.user_id

local method = {
    ["led_display"] = handle_led_display,
    ["alarm"] = handle_alarm,
    ["history"] = handle_history,
    ["unsubscribe"] = handle_unsubscribe,
}

local handle_led_display = function()
    local res = {
        [""]
    }
    return 


if not common_util.check_args(2, user_id, func) then
    common_util.exit(200, 0, nil, "101", "userid or type is missing")
end

if not method[func] then
    common_util.exit(200, 0, nil, "101", "type is missing")
end

local permission = redis_util.redis_cmd("signature", "sismember", "permission", user_id)
if permission == 1 then
    method[func]()
end


common_util.exit(200, 0, nil, "101", "param is error")




